package src.jdbc;

import java.sql.*;
import java.sql.DriverManager;
/**
 *
 * @author Rodrigo
 */
public class PostgreSQL
{

    public static Connection getConnection()
    {
        Connection conexion = null;
        try
        {
            String diverClassName =("org.postgresql.Driver");
            String driverUrl = "jdbc:postgresql://127.0.0.1:5432/siae";
            Class.forName(diverClassName);
            conexion = DriverManager.getConnection(driverUrl , "postgres", "postgres");


//            Class.forName("org.postgresql.Driver");
//            conexion = DriverManager.getConnection("jdbc:postgresql://naruto:5432/siae", "postgres", "siae");

        }
        catch (Exception e)
        {
            System.out.println("No se encontro DB");
        }
        return conexion;
    }
}
